Next | Prev | Up | Top | Contents | Index

Address Definition

Most of the possible addresses in an address space are undefined, that is, not entered in the page tables, not related to contents of any kind, and not available for use. A reference to an undefined address causes a SIGBUS error.

Addresses are defined, that is, made available for potential use, in one of four ways:

Fork

When a process is created using fork(), any addresses that were defined in the parent's address space are defined in the address space of the new process (see "Normal Process Creation With fork()").

Stack

The call stack is created and extended automatically. When a function is entered and more stack space is needed, IRIX makes the stack segment larger, defining new addresses if required.

Mapping

Your program can ask IRIX to map (associate byte-for-byte) a segment of address space to one of a number of special objects, for example, the contents of a file. This is covered further in the book Topics in IRIX Programming.

Allocation

The brk() function extends the segment devoted to data (the heap) to a specific virtual address. The malloc() function allocates memory for use, calling brk() as required. (See the brk(2) and malloc(3) reference pages). The more commonly used library version of malloc() calls the underlying malloc() (see the malloc(3x) reference page).
When an address is defined, it is entered in the page tables and related to a backing store, a source from which its contents can be retrieved. A page in the data or stack segment is related to a page in the swap partition on disk.

The total size of the defined pages in an address space is its virtual size, displayed by the ps command under the heading SZ (see the ps(1) reference page).


Next | Prev | Up | Top | Contents | Index